package com.geping.etl.common.dto;

import com.geping.etl.config.SysCodeConfig;

/***
 *  跑批结果
 * @author liang.xu
 * @date 2021.08.02
 */
public class KettleRunResultDto {

    private Integer code= SysCodeConfig.kettleSuccess;

    private String desc;

    public KettleRunResultDto() {

    }

    public static KettleRunResultDto success(){
        return new KettleRunResultDto();
    }

    public static KettleRunResultDto success(String desc){
        KettleRunResultDto kettleRunResultDto = new KettleRunResultDto();
        kettleRunResultDto.setDesc(desc);
        return kettleRunResultDto;
    }

    public static KettleRunResultDto results(String desc) {
        KettleRunResultDto kettleRunResultDto = new KettleRunResultDto();
        kettleRunResultDto.setCode(SysCodeConfig.ViewResults);
        kettleRunResultDto.setDesc(desc);
        return kettleRunResultDto;
    }

    public static KettleRunResultDto error(){
        return error(SysCodeConfig.kettleError,"");
    }

    public static KettleRunResultDto error(String desc){
        return error(SysCodeConfig.kettleError,desc);
    }

    public static KettleRunResultDto error(Integer code,String desc){
        KettleRunResultDto kettleRunResultDto=new KettleRunResultDto();
        kettleRunResultDto.setCode(code);
        kettleRunResultDto.setDesc(desc);
        return kettleRunResultDto;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}